package robocup.component.speechacts.coachlanguage;

public class DefineMessage {

  private TypeConstants.DEFINETYPE defineType      = TypeConstants.DEFINETYPE.INIT;

  private DefineCondition          defineCondition = null;

  private DefineAction             defineAction    = null;

  private DefineRegion             defineRegion    = null;

  private DefineDirective          defineDirective = null;

  private Definerset               definerset      = null;

  private DefineRule               defineRule      = null;

  public DefineDirective getDefineDirective() {

    return this.defineDirective;
  }

  public void setDefineDirective(final DefineDirective defineDirective) {

    this.defineDirective = defineDirective;
    this.defineType = TypeConstants.DEFINETYPE.DEFINED;
  }

  public DefineRegion getDefineRegion() {

    return this.defineRegion;
  }

  public void setDefineRegion(final DefineRegion defineRegion) {

    this.defineRegion = defineRegion;
    this.defineType = TypeConstants.DEFINETYPE.DEFINER;
  }

  public DefineRule getDefineRule() {

    return this.defineRule;
  }

  public void setDefineRule(final DefineRule defineRule) {

    this.defineRule = defineRule;
    this.defineType = TypeConstants.DEFINETYPE.DEFINERULE;
  }

  public DefineCondition getDefineCondition() {

    return this.defineCondition;
  }

  public void setDefineCondition(final DefineCondition defineCondition) {

    this.defineCondition = defineCondition;
    this.defineType = TypeConstants.DEFINETYPE.DEFINEC;
  }

  public DefineAction getDefineAction() {

    return this.defineAction;
  }

  public void setDefineAction(final DefineAction defineAction) {

    this.defineAction = defineAction;
    this.defineType = TypeConstants.DEFINETYPE.DEFINEA;
  }

  public TypeConstants.DEFINETYPE getDefineType() {

    return this.defineType;
  }

  public void setDefineType(final TypeConstants.DEFINETYPE defineType) {

    this.defineType = defineType;
  }

  public Definerset getDefinerset() {

    return this.definerset;
  }

  public void setDefinerset(final Definerset definerset) {

    this.definerset = definerset;
    this.defineType = TypeConstants.DEFINETYPE.DEFINERSET;
  }

  @Override
  public String toString() {

    final StringBuffer buf = new StringBuffer();

    switch (this.defineType) {

      case INIT:
        buf.append("empty");
        break;

      case DEFINEC:
        buf.append(this.defineCondition.toString());
        break;

      case DEFINEA:
        buf.append(this.defineAction.toString());
        break;

      case DEFINER:
        buf.append(this.defineRegion.toString());
        break;

      case DEFINED:
        buf.append(this.defineDirective.toString());
        break;

      case DEFINERULE:
        buf.append(this.defineRule.toString());
        break;
    }

    return buf.toString();
  }

}
